package it.polito.ai.lhmf.orm;

// Generated 8-giu-2012 18.52.32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Log generated by hbm2java
 */
@Entity
@Table(name = "log")
public class Log implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer idLog;
	private Member member;
	private String logtext;
	private Date logTimestamp;

	public Log() {
	}

	public Log(Member member, String logtext, Date logTimestamp) {
		this.member = member;
		this.logtext = logtext;
		this.logTimestamp = logTimestamp;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idLog", unique = true, nullable = false)
	public Integer getIdLog() {
		return this.idLog;
	}

	public void setIdLog(Integer idLog) {
		this.idLog = idLog;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idMember", nullable = false)
	public Member getMember() {
		return this.member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@Column(name = "logtext", nullable = false, length = 300)
	public String getLogtext() {
		return this.logtext;
	}

	public void setLogtext(String logtext) {
		this.logtext = logtext;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "log_timestamp", nullable = false, length = 19)
	public Date getLogTimestamp() {
		return this.logTimestamp;
	}

	public void setLogTimestamp(Date logTimestamp) {
		this.logTimestamp = logTimestamp;
	}

}
